﻿<%@ Page Language="C#" MasterPageFile="~/Layout.Master" AutoEventWireup="true" CodeBehind="freeRooms.aspx.cs" Inherits="PT.WebForm3" Title="Untitled Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="cpContent" ContentPlaceHolderID="cpContent" runat="server">
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:HotelConnectionString2 %>" 
        ProviderName="<%$ ConnectionStrings:HotelConnectionString2.ProviderName %>" 
        
        
        
        SelectCommand="SELECT     ro.name, ro.size, ro.cost, ro.id
FROM         Rooms AS ro">
    </asp:SqlDataSource>
    <asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
        AllowSorting="True" AutoGenerateColumns="False" BorderStyle="None" 
        CssClass="grid" DataSourceID="SqlDataSource1" 
        EmptyDataText="Nie ma aktualnie wolnych pokoi." Width="100%">
        <Columns>
            <asp:BoundField DataField="name" HeaderText="Nazwa" SortExpression="name" />
            <asp:BoundField DataField="cost" HeaderText="Cena za dobę" 
                SortExpression="cost" DataFormatString="{0} zł" />
            <asp:BoundField DataField="size" HeaderText="Rozmiar" SortExpression="size" 
                DataFormatString="{0} os./pokój" />
            <asp:HyperLinkField DataNavigateUrlFields="id" 
                DataNavigateUrlFormatString="addReservation.aspx?id={0}" 
                HeaderText="Rezerwacja" NavigateUrl="~/pages/addReservation.aspx" 
                Text="Dodaj" />
        </Columns>
    </asp:GridView>
</asp:Content>
